Skip to main content
Version: 4.2.1

Joins vs. Unions

By default, dReveal automatically establishes Join relationships between objects when you add more than one to a dReveal View. This functionality, referred to as 'dReveal Joins,' is enabled as the default setting.

If you wish to disable this behavior, you can do so via the dR View options found in the right-bottom panel. Simply deactivate the 'JOIN' property. This action will result in the generation of a UNION operation instead of Joining objects.

After Adding tables or views to the dr View, You'll observe that the relationships panel no longer displays any JOIN clauses

Below is the resulting SQL query generated from the dR View configuration above:

SELECT DimCustomer.FirstName AS FirstName
,DimCustomer.Gender AS Gender
FROM DimCustomer DimCustomer

UNION ALL

SELECT DimEmployee.FirstName AS FirstName
,DimEmployee.Gender AS Gender
FROM DimEmployee DimEmployee

When Unions are enabled, the resulting SQL query will incorporate a 'UNION ALL' clause to merge data from these individual objects.

However, please note that specific conditions must be met for this transformation:

  1. No Existing Relationships: In the dR View context, there should be no pre-existing relationships between the objects.

  2. Matching Columns: The selected columns from each object within the dR View context must align in both their position and data type. (Make sure you select fields from each table in the dR View when stablishing the UNION.)

This flexibility in choosing between Joins and Unions empowers you to customize your dReveal Views according to your precise data modeling requirements.